package com.ruoyi.erp.domain.bo;

import com.ruoyi.common.annotation.query.EQ;
import com.ruoyi.common.annotation.query.LikeRight;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.erp.domain.vo.SysCodeRuleDetailVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 编码规则业务对象 sys_code_rule
 *
 * @author chenyun
 * @date 2022-03-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("编码规则业务对象")
public class SysCodeRuleBo extends BaseEntity {

    /**
     * 编号
     */
    @EQ
    @ApiModelProperty(value = "编号", required = true)
    @NotNull(message = "编号不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 编码
     */
    @EQ
    @ApiModelProperty(value = "编码", required = true)
    @NotBlank(message = "编码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String ruleCode;

    /**
     * 名称
     */
    @LikeRight
    @ApiModelProperty(value = "名称", required = true)
    @NotBlank(message = "名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String ruleName;

    /**
     * 业务
     */
    @EQ
    @ApiModelProperty(value = "业务", required = true)
    @NotNull(message = "业务不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long bizId;

    /**
     * 表名
     */
    @LikeRight
    @ApiModelProperty(value = "表名", required = true)
    private String tableName;

    /**
     * 机构
     */
    @EQ
    @ApiModelProperty(value = "机构", required = true)
    @NotNull(message = "机构不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long orgId;

    /**
     * 状态
     */
    @EQ
    @ApiModelProperty(value = "状态", required = true)
    private String status;

    /**
     * 备注
     */
    @EQ
    @ApiModelProperty(value = "备注")
    private String remark;

    private List<SysCodeRuleDetailVo> sysCodeRuleDetailList;
}
